﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using log4net;
using System.Reflection;
using System.Diagnostics;
using log4net.Config;

namespace QASampling.Util
{
    class LogUtil
    {
        private static bool isInitialized;

        internal static void WriteLog(string message)
        {
            var stack = new StackTrace();
            var frame = stack.GetFrame(1);
            ILog logger = LogManager.GetLogger(frame.GetMethod().DeclaringType);
            if (!isInitialized)
            {
                XmlConfigurator.Configure();
                isInitialized = true;
            }
            logger.Debug(message);        
        }
    }
}
